module code_jud(
	//input
		clk_1m,
		clk_250k,
		rst_n,
		check_over,
		oe,
		async_rxd,
		sram_ack,
		sram_data_out,	
	//output
		sram_addr,
		sram_wr,
		sram_rd,
		end_flag,		  
		jud_err	,
		rxd_fliter,
		oe_128,
        data,
        data_val
);

input   clk_1m,
		clk_250k,
		rst_n,
		check_over,
		oe,
		async_rxd,
		sram_ack;
input	[7:0]	sram_data_out;

output  [12:0] sram_addr;	  
output	sram_wr,
		sram_rd,
		end_flag,		  
		jud_err;
output  rxd_fliter;
output  oe_128;
output  data,
        data_val;

wire oe_64;
wire oe_128;
wire jud_err64;
wire jud_err128;
wire crc_req;
wire p_err;
wire frame_vaild;
wire [7:0]	dll_data;
wire [12:0]	sram_addr64,
			sram_addr128;
wire [15:0]	crc_dll;
wire [7:0]	sram_data_out;
wire sram_ack;
wire    mod,
		sram_rd64,
		sram_rd128,
		end_flag64,
		end_flag128;

dll U1_pll (	
	//input
		.clk_1m(clk_1m),
		.clk_250k(clk_250k),
		.rst_n(rst_n),
		.check_over(check_over),
		.oe(oe),
		.crc_req(crc_req),
		.async_rxd(async_rxd),

	//output	
		.frame_vaild(frame_vaild),
		.p_err(p_err),
		.crc(crc_dll),
		.mode(mod),
		.dout(dll_data),
		.rxd_fliter(rxd_fliter),
        .data(data),
        .data_val(data_val)
);  
	   
mod_en U2_mod_en(
	//input
	    .mod(mod),
		.oe(oe),
		.end_flag64(end_flag64),
		.end_flag128(end_flag128),
		.jud_err64(jud_err64),
		.jud_err128(jud_err128),
		.sram_rd64(sram_rd64),
		.sram_rd128(sram_rd128),
		.sram_addr64(sram_addr64),
		.sram_addr128(sram_addr128),
	//output
		.oe_64(oe_64),
		.oe_128(oe_128),
		.sram_rd(sram_rd),
		.jud_err(jud_err),
		.sram_addr(sram_addr),
		.end_flag(end_flag)
);	   
	   
jud_cmd_64 U3_jud_cmd_64(
			//input
				.clk_1m(clk_1m),
				.rst_n(rst_n),
				.oe_64(oe_64),
				.frame_vaild(frame_vaild),
				.dll_data(dll_data),
				.sram_ack(sram_ack),
				.p_err(p_err),
				.sram_data_out(sram_data_out),
			
			//output
				.sram_wr(sram_wr),
				.sram_rd(sram_rd64),
				.sram_addr(sram_addr64),
				.jud_err(jud_err64),
				.end_flag(end_flag64)
				);	   

jud_cmd_128 U4_jud_cmd_128(
			//input
				.clk_1m(clk_1m),
				.rst_n(rst_n),
				.oe_128(oe_128),
				.frame_vaild(frame_vaild),
				.dll_data(dll_data),
				.sram_ack(sram_ack),
				.p_err(p_err),
				.sram_data_out(sram_data_out),
				.crc_from_dll(crc_dll),
			
			//output
				.sram_wr(),
				.sram_rd(sram_rd128),
				.sram_addr(sram_addr128),
				.jud_err(jud_err128),
				.crc_req(crc_req),
				.end_flag(end_flag128)
				);	
					
endmodule				
      
